{
    class User{
        name: string
        age: number
        constructor(a:string,b:number){
            this.name = a;
            this.age = b;
        }

        show():string {
            return `${this.name}的年龄是${this.age}`;
        }
    }

    let hd = new User('后端人',18);
    let xia = new User('xiasnn',16);
    console.log(hd.show());
    console.log(xia.show());

    // users数组只能放User类型的元素
    const users:User[] = [];
    users.push(hd,xia);
    console.log(users);
}